package com.bitantenna;

public class SpotStats {
	private int statsDepth=0;		
	private SpotStatsSampling statsSamplesProduced=new SpotStatsSampling();
	private SpotStatsSampling statsSamplesConsumed=new SpotStatsSampling();
	private int reconnectingCount=0;
	
	public void notifyReconnectingCount() {
		++reconnectingCount;
	}
	
	public int statsReconnectingCount() {
		return reconnectingCount;
	}
	
	public int statsConsumersTreeCount(Spot spot) {
		int treeCount=0;
		for(SpotInfo s:spot.consumers().spotsAsList()) {
			treeCount+=s.statsConsumerTreeCount();
		}
		return spot.consumers().spotsAsList().size()+treeCount;
	}
	public int statsDepth() {
		return statsDepth;
	}
	
	public void statsDepth(int depth) {
		this.statsDepth=depth;
	}
	
	public SpotStatsSampling statsSamplesProduced() {
		return statsSamplesProduced;
	}

	public SpotStatsSampling statsSamplesConsumed() {
		return statsSamplesConsumed;
	}

}
